package com.ag.utils;

import java.util.Collection;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * @author <a href="mailto:rplees.i.ly@gmail.com">rplees</a>
 * date 2010-03-29
 * {@code} 分页实体类
 * @param <T> 实体
 */
public class Page<T> {
	public static final int DEFAULT_PAGE_SIZE = 20;
	
	int pageSize = DEFAULT_PAGE_SIZE;    				//每页显示数 
	int currentPage = 1;  				//当前页码，即要跳转的页码
	int totalCount = -1;   			//数据的总数（？条）
	int totalPage = -1;
	Collection<T> items ;				//查询返回的结果集
	
	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public Collection<T> getItems() {
		return items;
	}

	public void setItems(Collection<T> items) {
		this.items = items;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}